<template>
  <div class="Showcase1">
    <div class="shadow-box">
      <img class="shadow-left" :src="publicUrls + 'free/style3/Showcase4bg9.webp'" alt="" />
      <div
        class="shadow-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style3/Showcase4bg10.webp'})`,
        }"
      >
        <img
          class="shadow-center-center"
          :src="publicUrls + 'free/style3/Showcase4bg12.webp'"
          alt=""
        />
      </div>
      <img class="shadow-right" :src="publicUrls + 'free/style3/Showcase4bg11.webp'" alt="" />
    </div>

    <div class="Showcase1-top">
      <img
        class="Showcase1-top-left"
        :src="publicUrls + 'free/style3/Showcase4bg1.webp'"
        alt=""
      />
      <div
        class="Showcase1-top-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style3/Showcase4bg2.webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-top-right"
        :src="publicUrls + 'free/style3/Showcase4bg3.webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-center">
      <div
        :style="{
          left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(index), item.width, 1.333)}rem`,
          backgroundImage: `url(${publicUrls + 'free/style3/Showcase4NameBg.webp'})`,
        }"
        class="ex-item"
        v-for="(item, index) in props.list"
        :key="index"
      >
        <p class="name-box">
          {{ item.name }}
        </p>
      </div>
      <img
        class="Showcase1-center-left"
        :src="publicUrls + 'free/style3/Showcase4bg4.webp'"
        alt=""
      />
      <div
        class="Showcase1-center-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style3/Showcase4bg5.webp'})`,
        }"
      ></div>
      <div class="Showcase1-center-right"></div>
    </div>
    <div class="Showcase1-bottom">
      <img
        class="Showcase1-bottom-left"
        :src="publicUrls + 'free/style3/Showcase4bg6.webp'"
        alt=""
      />
      <div
        class="Showcase1-bottom-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style3/Showcase4bg7.webp'})`,
        }"
      >
        <img
          class="Showcase1-bottom-center-center"
          :src="publicUrls + 'free/style3/Showcase4bg13.webp'"
          alt=""
        />
      </div>
      <img
        class="Showcase1-bottom-right"
        :src="publicUrls + 'free/style3/Showcase4bg8.webp'"
        alt=""
      />
    </div>
    <!-- Showcase1Topleft -->
  </div>
</template>    

<script lang="ts">
export default defineComponent({
  name: 'style4',
});
</script> 
   
<script setup lang="ts">
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { publicUrls } from '@/utils/minxin';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }

  return x;
};
</script>  

<style scoped lang="less">
.Showcase1 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 2.056rem;
  min-width: 1.333rem;
}
.Showcase1-top {
  display: flex;
  width: 100%;
  height: 80px;
}
.Showcase1-top-left {
  width: 70px;
  height: 80px;
}
.Showcase1-top-center {
  flex: 1;
  height: 80px;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase1-top-right {
  width: 60px;
  height: 80px;
}
.Showcase1-center {
  position: relative;
  display: flex; 
  width: 100%;
  height: calc(100% - 170px);
}
.ex-item {
  display: flex;
  justify-content: center;
  position: absolute;
  top: 20px;
  width: 192px;
  height: 44px;
  z-index: 30;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.name-box {
  width: 176px;
  height: 28px;
  font-family: SourceHanSerifCN-Bold;
  font-size: 18px;
  color: rgba(98, 51, 51, 1);
  line-height: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  margin-top: 8px;
}
.Showcase1-center-left {
  width: 60px;
  height: 100%;
}
.Showcase1-center-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase1-center-right {
  width: 10px;
  height: 100%;
}
.Showcase1-bottom {
  display: flex;
  width: 100%;
  height: 90px;
}
.Showcase1-bottom-left {
  width: 60px;
  height: 90px;
}
.Showcase1-bottom-center {
  position: relative;
  flex: 1;
  height: 90px; 
  background-repeat: repeat;
  background-size: auto 100%;
  .Showcase1-bottom-center-center {
    position: absolute;
    top: -52px;
    left: calc(50% - 16px);
    width: 32px;
    height: 102px;

    z-index: 12;
  }
}
.Showcase1-bottom-right {
  width: 10px;
  height: 90px;
}
.shadow-box {
  display: flex;
  position: absolute;
  bottom: -340px;
  left: 0;
  width: 100%;
  height: 360px;
  z-index: -1;
}
.shadow-left {
  width: 60px;
  height: 360px;
}
.shadow-center {
  position: relative;
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
  .shadow-center-center {
    position: absolute;
    top: 90px;
    left: calc(50% - 16px);
    width: 32px;
    height: 102px;
    z-index: 12;
  }
}
.shadow-right {
  width: 10px;
  height: 360px;
}
</style>